<script setup lang="ts">
import {PAY_TYPE} from "~/const/Maps";
const time=ref([]);
definePageMeta({
  layout:'admin',
  title:'用户流水记录',
});
const form=reactive({
  limit:20,
  page:1,
  user_id:'',
});

const {data:list,refresh}=await useServerGet('/backend/finance/getFlowList',form)
const search=()=>{
  refresh&&refresh();
}
</script>

<template>
<div>
  <el-card>
    <div class="flex">
      <div class="w-52 mr-2">
        <el-input placeholder="请输入用户" v-model="form.user_id" class="w-40" clearable></el-input>
      </div>
      <div class="w-20">
        <el-button type="primary" @click="search">搜索</el-button>
      </div>
    </div>
  </el-card>
  <el-card class="mt-4">
    <el-table
        ref="multipleTable1"
        :data="list.data?.list"
        tooltip-effect="dark"
        style="width: 100%"
        align="center"
        >
      <el-table-column prop="id" label="ID"></el-table-column>
      <el-table-column prop="user_id" label="用户ID"></el-table-column>
      <el-table-column prop="type" label="类型">
        <template #default="{row}">
          {{row.type}}
        </template>
      </el-table-column>
      <el-table-column prop="money" label="金额"></el-table-column>
      <el-table-column prop="updated_at" label="更新时间"></el-table-column>
      <el-table-column prop="created_at" label="创建时间"></el-table-column>
    </el-table>
    <MyPage v-model:page="form.page" v-model:perpage="form.limit" v-model:total="list.data.total" @change="refresh"></MyPage>
  </el-card>
</div>
</template>

<style scoped lang="scss">

</style>